<!-- apps/frontend/modules/item/templates/indexSuccess.php -->

<?php use_stylesheet('items.css') ?>
 <div id="item">
  <?php foreach ($categories as $category): ?>
    <div class="category_<?php echo His::slugify($category->getName()) ?>">
      <div class="category">
        
        <h1>
          <?php echo link_to($category, 'category', $category) ?>
        </h1>
      </div>
 
      <?php include_partial('item/list', array('items' => $category->getAllItems(sfConfig::get('app_max_items_on_homepage')))) ?>
          <?php if (($count = $category->countAllItems() - sfConfig::get('app_max_items_on_homepage')) > 0): ?>
        <div class="more_items">
          and <?php echo link_to($count, 'category', $category) ?>
          more...
        </div>
      <?php endif; ?>
    </div>
  <?php endforeach; ?>
</div>